//
//  AboutScene.cpp
//  Frog Jump
//
//  Created by acumen on 7/26/13.
//
//

#include "AboutScene.h"
#include "CCControlButton.h"
#include "CCScale9Sprite.h"

USING_NS_CC;
using namespace extension;


bool AboutScene::init() {
    if (!CCLayer::init()) {
        return false;
    }
    CCSize winSize = GameController::getWinSize();
    
    // Background
    CCSprite *pBackground = CCSprite::create(IMG_BACKGROUND_IPHONE_HD);
    pBackground->setAnchorPoint(CCPointZero);
    pBackground->setPosition(CCPointZero);
    addChild(pBackground);
    // Title
    CCLabelTTF *pTitle = CCLabelTTF::create(STR_ABOUT, FONT_TITLE, 56);
    pTitle->setPosition(CCPointMake(winSize.width/2, winSize.height/2 + 250));
    addChild(pTitle);
    
    // Powered
    CCLabelTTF *pLabelPower = CCLabelTTF::create(STR_POWERED_BY, FONT_CONTENT, 44);
    pLabelPower->setPosition(CCPointMake(480, 460));
    addChild(pLabelPower);
    
    // Cocos2d logo
    CCSprite *pCocos2dLogo = CCSprite::create(IMG_COCOS_LOGO);
    pCocos2dLogo->setAnchorPoint(CCPointZero);
    pCocos2dLogo->setScale(0.5f);
    pCocos2dLogo->setPosition(CCPointMake(184, 280));
    addChild(pCocos2dLogo);
    
    // Send feedback label
    CCLabelTTF *pLabelFeedback = CCLabelTTF::create(STR_CONTACT_INFO, FONT_CONTENT, 44);
    pLabelFeedback->setPosition(CCPointMake(480, 224));
    addChild(pLabelFeedback);
    
    // Email
    CCLabelTTF *pLabelEmail = CCLabelTTF::create(STR_EMAIL, FONT_CONTENT, 36);
    pLabelEmail->setPosition(CCPointMake(482, 166));
    addChild(pLabelEmail);
    
    // Btn back
    CCMenuItemLabel *pBtnBack = CCMenuItemLabel::create(CCLabelTTF::create(STR_BACK, FONT_MENU, 56), this, menu_selector(AboutScene::backToMenu));
    // Menu
    CCMenu *pMenu = CCMenu::create(pBtnBack, NULL);
    pMenu->setAnchorPoint(CCPointZero);
    pMenu->setPosition(CCPointMake(100, 64));
    addChild(pMenu);
    return true;
}

CCScene *AboutScene::scene() {
    CCScene *pScene = CCScene::create();
    AboutScene *pLayer = AboutScene::create();
    pScene->addChild(pLayer);
    return pScene;
}

AboutScene::~AboutScene() {
    
}
